package com.zenika.zenbinding.client.converter;

import com.zenika.zenbinding.client.exception.ConverterException;

/**
 * Converter for the String class.
 * @author Zenika
 */
public class StringConverter implements Converter {

	public String fromObjectToString(Object object) throws ConverterException {
		try {
			return object.toString();
		} catch (ClassCastException e) {
			throw new ConverterException();
		}
	}

	public Object fromStringToObject(String string) throws ConverterException {
		return string;
	}

}
